using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ibba.agil.core;
using ibba.agil.core.common;

namespace ibba.agil.data.data
{
    public class tbagi006IpiLayo_ENT : EntityData, IDataEntity
    {
        private manager.tbagi006IpiLayo_MNG _manager;

        #region Data

        public int idtIpiLayo { get; set; }
        public string codTipoLayo { get; set; }
        public string nomIpiLayo { get; set; }
        public int numVersLayo { get; set; }
        public DateTime datInioVige { get; set; }
        public DateTime ? datFinaVige { get; set; }

        #endregion

        /// <summary>
        /// Construtor necessario para configura��o dos mapeamentos :: Entidade < -- > TABELA
        /// </summary>
        public tbagi006IpiLayo_ENT()
        {
            // determina o mapeamento entre a tabela e entidade
            base.MapperTable = new Dictionary<string, string>() { { this.GetType().Name, "dbo.TBAGI006_IPI_LAYO" } };

            // determina o mapeamento entre a coluna da tabela e propriedade
            base.Mapper = new Dictionary<string, string>() { 
                     {"idtIpiLayo" , "IDT_IPI_LAYO"  }, 
                     {"codTipoLayo", "COD_TIPO_LAYO" }, 
                     {"nomIpiLayo" , "NOM_IPI_LAYO"  }, 
                     {"numVersLayo", "NUM_VERS_LAYO" }, 
                     {"datInioVige", "DAT_INIO_VIGE" }, 
                     {"datFinaVige", "DAT_FINA_VIGE" }          
            };

            // determina o mapeamento das chaves
            base.MapperKeys = new Dictionary<string, string>() { 
                    //DictionaryEntityKey//
                     {"idtIpiLayo", "IDT_IPI_LAYO"    }
            };

            // instancia o manager
            _manager = new manager.tbagi006IpiLayo_MNG();
        }

        public override void Save()
        {
            _manager.Save(this);
        }

        public override void Save(TransactionManager transactionContext)
        {
            _manager.Save(this, transactionContext);
        }

        public override void Delete()
        {
            _manager.Delete(this);
        }

        public override void Delete(TransactionManager transactionContext)
        {
            throw new NotImplementedException();
        }
    }
}
